#define _CRT_SECURE_NO_WARNINGS 1
#include<ctype.h>
#include<algorithm>
#include<string>
#include<iostream>

using namespace std;

int main()
{
	string str;
	getline(cin, str);
	reverse(str.begin(), str.end());
	for (int i = 0; i < str.size(); i++) {
		if (islower(str[i])) str[i] -= 32;
		else if (isupper(str[i])) str[i] += 32;
	}
	cout << str;
	return 0;
}